
#if !defined(_CPORTFOLIOMANAGER_H)
#define _CPORTFOLIOMANAGER_H

namespace GSTrader
{
	namespace TradeStrategy
	{
		class CPortfolio;
		class CFramework;
		class TRADE_STRATEGY_API CPortfolioManager
		{
		public:
			CPortfolioManager(CFramework* pFramework);
			virtual ~CPortfolioManager();

			void Add(CPortfolio*);
			void Clear();
			bool Remove(int nId);
			CPortfolio* GetPortfolioById(int nId);
			void OnExecutionReport(CExecutionReport* pReport);

		private:
			CFramework* m_pFramework;
			atomic<int> m_nNextId;
			map<int, CPortfolio* > m_mapPortfolio;
		};
	}
}

#endif // _CPORTFOLIOMANAGER_H